import { S } from '../../s';
import { IPSAppCounterRef } from '../control/ipsapp-counter-ref';
import { IPSAppDataEntity } from '../dataentity/ipsapp-data-entity';
import { IPSAppUILogicRefView } from './ipsapp-uilogic-ref-view';
import { IPSAppView } from '../view/ipsapp-view';
import { IPSAppViewLogic } from '../view/ipsapp-view-logic';
import { IPSAppViewMsgGroup } from '../view/ipsapp-view-msg-group';
import { IPSAppViewNavContext } from '../view/ipsapp-view-nav-context';
import { IPSAppViewNavParam } from '../view/ipsapp-view-nav-param';
import { IPSAppViewParam } from '../view/ipsapp-view-param';
import { IPSAppViewRef } from '../view/ipsapp-view-ref';
import { IPSControl } from '../../control/ipscontrol';
import { IPSNavigateContext } from '../../control/ipsnavigate-context';
import { IPSNavigateParam } from '../../control/ipsnavigate-param';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysCss } from '../../res/ipssys-css';
import { IPSSysImage } from '../../res/ipssys-image';
import { IPSSysPFPlugin } from '../../res/ipssys-pfplugin';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSAppUILogicRefViewImpl
  extends PSModelObjectImpl
  implements IPSAppUILogicRefView
{
  get accUserMode(): 0 | 2 | 3 | 4 {
    return this.M.accUserMode;
  }

  get accessKey(): string {
    return this.M.accessKey;
  }

  protected cappslanguageres: IPSLanguageRes;
  getCapPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.cappslanguageres ||
      (this.cappslanguageres = this.fillObjectModel(
        S._276,
        this.M.getCapPSLanguageRes,
        S._2a8,
      ) as IPSLanguageRes)
    );
  }

  get caption(): string {
    return this.M.caption;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get fullCodeName(): string {
    return this.M.fullCodeName;
  }

  get funcViewMode():
    | 'PICKUPVIEW'
    | 'EDITVIEW'
    | 'MAINVIEW'
    | 'INDEXDEPICKUPVIEW'
    | 'FORMPICKUPVIEW'
    | 'MPICKUPVIEW'
    | 'MDATAVIEW'
    | 'WFEDITVIEW'
    | 'WFMDATAVIEW'
    | 'WFSTARTVIEW'
    | 'WFACTIONVIEW'
    | 'WFUTILACTIONVIEW'
    | 'REDIRECTVIEW'
    | 'MOBPICKUPVIEW'
    | 'MOBEDITVIEW'
    | 'MOBMAINVIEW'
    | 'MOBINDEXDEPICKUPVIEW'
    | 'MOBFORMPICKUPVIEW'
    | 'MOBMPICKUPVIEW'
    | 'MOBMDATAVIEW'
    | 'MOBWFEDITVIEW'
    | 'MOBWFMDATAVIEW'
    | 'MOBWFSTARTVIEW'
    | 'MOBWFACTIONVIEW'
    | 'MOBWFUTILACTIONVIEW'
    | 'MOBREDIRECTVIEW' {
    return this.M.funcViewMode;
  }

  get funcViewParam(): string {
    return this.M.funcViewParam;
  }

  get height(): number {
    return this.M.height != null ? this.M.height : 0;
  }

  get mainMenuAlign(): string {
    return this.M.mainMenuAlign;
  }

  get openMode(): string {
    return this.M.openMode;
  }

  protected psappcounterref: IPSAppCounterRef;
  getPSAppCounterRef(): IPSAppCounterRef | null {
    return (
      this.psappcounterref ||
      (this.psappcounterref = this.fillObjectModel(
        S._9d,
        this.M.getPSAppCounterRef,
        S._2a9,
      ) as IPSAppCounterRef)
    );
  }

  protected psappdataentity: IPSAppDataEntity;
  getPSAppDataEntity(): IPSAppDataEntity | null {
    return (
      this.psappdataentity ||
      (this.psappdataentity = this.fillObjectModel(
        S._f,
        this.M.getPSAppDataEntity,
        S._2aa,
      ) as IPSAppDataEntity)
    );
  }

  protected psappviewlogics: IPSAppViewLogic[];
  getPSAppViewLogics(): IPSAppViewLogic[] | null {
    return (
      this.psappviewlogics ||
      (this.psappviewlogics = this.fillChildListModel(
        this.M.getPSAppViewLogics,
        S._82,
      ) as IPSAppViewLogic[])
    );
  }

  findPSAppViewLogic(objKey: any): IPSAppViewLogic | null {
    return this.getPSModel5(
      S._82,
      this.getPSAppViewLogics(),
      objKey,
    ) as IPSAppViewLogic;
  }

  protected psappviewmsggroup: IPSAppViewMsgGroup;
  getPSAppViewMsgGroup(): IPSAppViewMsgGroup | null {
    return (
      this.psappviewmsggroup ||
      (this.psappviewmsggroup = this.fillObjectModel(
        S._85,
        this.M.getPSAppViewMsgGroup,
        S._2ab,
      ) as IPSAppViewMsgGroup)
    );
  }

  protected psappviewnavcontexts: IPSAppViewNavContext[];
  getPSAppViewNavContexts(): IPSAppViewNavContext[] | null {
    return (
      this.psappviewnavcontexts ||
      (this.psappviewnavcontexts = this.fillChildListModel(
        this.M.getPSAppViewNavContexts,
        S._8b,
      ) as IPSAppViewNavContext[])
    );
  }

  findPSAppViewNavContext(objKey: any): IPSAppViewNavContext | null {
    return this.getPSModel5(
      S._8b,
      this.getPSAppViewNavContexts(),
      objKey,
    ) as IPSAppViewNavContext;
  }

  protected psappviewnavparams: IPSAppViewNavParam[];
  getPSAppViewNavParams(): IPSAppViewNavParam[] | null {
    return (
      this.psappviewnavparams ||
      (this.psappviewnavparams = this.fillChildListModel(
        this.M.getPSAppViewNavParams,
        S._89,
      ) as IPSAppViewNavParam[])
    );
  }

  findPSAppViewNavParam(objKey: any): IPSAppViewNavParam | null {
    return this.getPSModel5(
      S._89,
      this.getPSAppViewNavParams(),
      objKey,
    ) as IPSAppViewNavParam;
  }

  protected psappviewparams: IPSAppViewParam[];
  getPSAppViewParams(): IPSAppViewParam[] | null {
    return (
      this.psappviewparams ||
      (this.psappviewparams = this.fillChildListModel(
        this.M.getPSAppViewParams,
        S._88,
      ) as IPSAppViewParam[])
    );
  }

  findPSAppViewParam(objKey: any): IPSAppViewParam | null {
    return this.getPSModel5(
      S._88,
      this.getPSAppViewParams(),
      objKey,
    ) as IPSAppViewParam;
  }

  protected psappviewrefs: IPSAppViewRef[];
  getPSAppViewRefs(): IPSAppViewRef[] | null {
    return (
      this.psappviewrefs ||
      (this.psappviewrefs = this.fillChildListModel(
        this.M.getPSAppViewRefs,
        S._8d,
      ) as IPSAppViewRef[])
    );
  }

  findPSAppViewRef(objKey: any): IPSAppViewRef | null {
    return this.getPSModel5(
      S._8d,
      this.getPSAppViewRefs(),
      objKey,
    ) as IPSAppViewRef;
  }

  protected pscontrols: IPSControl[];
  getPSControls(): IPSControl[] | null {
    return (
      this.pscontrols ||
      (this.pscontrols = this.fillChildListModel(
        this.M.getPSControls,
        S._214,
      ) as IPSControl[])
    );
  }

  findPSControl(objKey: any): IPSControl | null {
    return this.getPSModel5(S._214, this.getPSControls(), objKey) as IPSControl;
  }

  getPSDEViewCodeName(): string {
    return this.M.getPSDEViewCodeName;
  }

  getPSDEViewId(): string {
    return this.M.getPSDEViewId;
  }

  protected psnavigatecontexts: IPSNavigateContext[];
  getPSNavigateContexts(): IPSNavigateContext[] | null {
    return (
      this.psnavigatecontexts ||
      (this.psnavigatecontexts = this.fillChildListModel(
        this.M.getPSNavigateContexts,
        S._8c,
      ) as IPSNavigateContext[])
    );
  }

  findPSNavigateContext(objKey: any): IPSNavigateContext | null {
    return this.getPSModel5(
      S._8c,
      this.getPSNavigateContexts(),
      objKey,
    ) as IPSNavigateContext;
  }

  protected psnavigateparams: IPSNavigateParam[];
  getPSNavigateParams(): IPSNavigateParam[] | null {
    return (
      this.psnavigateparams ||
      (this.psnavigateparams = this.fillChildListModel(
        this.M.getPSNavigateParams,
        S._8a,
      ) as IPSNavigateParam[])
    );
  }

  findPSNavigateParam(objKey: any): IPSNavigateParam | null {
    return this.getPSModel5(
      S._8a,
      this.getPSNavigateParams(),
      objKey,
    ) as IPSNavigateParam;
  }

  protected pssyscss: IPSSysCss;
  getPSSysCss(): IPSSysCss | null {
    return (
      this.pssyscss ||
      (this.pssyscss = this.fillObjectModel(
        S._278,
        this.M.getPSSysCss,
        S._2ac,
      ) as IPSSysCss)
    );
  }

  protected pssysimage: IPSSysImage;
  getPSSysImage(): IPSSysImage | null {
    return (
      this.pssysimage ||
      (this.pssysimage = this.fillObjectModel(
        S._27b,
        this.M.getPSSysImage,
        S._2ad,
      ) as IPSSysImage)
    );
  }

  protected pssyspfplugin: IPSSysPFPlugin;
  getPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.pssyspfplugin ||
      (this.pssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getPSSysPFPlugin,
        S._2a7,
      ) as IPSSysPFPlugin)
    );
  }

  protected parentpsappdataentity: IPSAppDataEntity;
  getParentPSAppDataEntity(): IPSAppDataEntity | null {
    return (
      this.parentpsappdataentity ||
      (this.parentpsappdataentity = this.fillObjectModel(
        S._f,
        this.M.getParentPSAppDataEntity,
        S._2ae,
      ) as IPSAppDataEntity)
    );
  }

  get priority(): number {
    return this.M.priority != null ? this.M.priority : -1;
  }

  get refFlag(): boolean {
    return this.M.refFlag != null ? this.M.refFlag : true;
  }

  get refMode(): string {
    return this.M.refMode;
  }

  protected refpsappview: IPSAppView;
  getRefPSAppView(): IPSAppView | null {
    return (
      this.refpsappview ||
      (this.refpsappview = this.fillObjectModel(
        S._1e,
        this.M.getRefPSAppView,
        S._2af,
      ) as IPSAppView)
    );
  }

  protected subcappslanguageres: IPSLanguageRes;
  getSubCapPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.subcappslanguageres ||
      (this.subcappslanguageres = this.fillObjectModel(
        S._276,
        this.M.getSubCapPSLanguageRes,
        S._2b0,
      ) as IPSLanguageRes)
    );
  }

  get subCaption(): string {
    return this.M.subCaption;
  }

  get tempMode(): 0 | 1 | 2 {
    return this.M.tempMode != null ? this.M.tempMode : 0;
  }

  get title(): string {
    return this.M.title;
  }

  protected titlepslanguageres: IPSLanguageRes;
  getTitlePSLanguageRes(): IPSLanguageRes | null {
    return (
      this.titlepslanguageres ||
      (this.titlepslanguageres = this.fillObjectModel(
        S._276,
        this.M.getTitlePSLanguageRes,
        S._2b1,
      ) as IPSLanguageRes)
    );
  }

  get viewType(): string {
    return this.M.viewType;
  }

  get width(): number {
    return this.M.width != null ? this.M.width : 0;
  }

  get enableDP(): boolean {
    return this.M.enableDP;
  }

  get enableWF(): boolean {
    return this.M.enableWF;
  }

  get pickupMode(): boolean {
    return this.M.pickupMode != null ? this.M.pickupMode : false;
  }

  get redirectView(): boolean {
    return this.M.redirectView != null ? this.M.redirectView : false;
  }

  get showCaptionBar(): boolean {
    return this.M.showCaptionBar != null ? this.M.showCaptionBar : true;
  }
  get cls(): string {
    return 'PSAppUILogicRefViewImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._5 || cls == S._6 || cls == S._7) return true;
    return super.instanceof(cls);
  }
}
